package com.earthchen.domain.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import java.io.Serializable;


/**
 * 父类实体
 *
 * @author earthchen
 * @date 2018/8/31
 */
public class BaseEntity<T extends Model> extends Model<T>
{

    private static final long serialVersionUID = -4263419124367119871L;

    /**
     * 主键ID , 这里故意演示注解可以无
     */
    @TableId("id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @Override
    protected Serializable pkVal()
    {
        return this.id;
    }

    public Long getId()
    {
        return id;
    }

    public void setId(Long id)
    {
        this.id = id;
    }


}